QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Managing the Video Frame Playback Rate

QuickTime 2.1 introduced two new functions for determining the rate at which a QuickTime movie plays back each video frame. You should use these functions for debugging.

GetVideoMediaStatistics

The GetVideoMediaStatistics function returns the play-back frame rate of a movie. This call can only be used on video or MPEG media handlers.

pascal Fixed GetVideoMediaStatistics (
                     MediaHandler mh);
mh
Contains a reference to a video media handler. You obtain this reference from the GetMediaHandler function.
function result
Returns the movie's play-back frame rate in frames-per-second.

Description

The GetVideoMediaStatistics returns the average frame rate since the last time ResetVideoMediaStatistics was called. Because of sampling errors, the values returned from GetVideoMediaStatistics are accurate only after waiting at least one second after calling ResetVideoMediaStatistics .

Because not all QuickTime movies have a constant frame rate, the results of this call can be difficult to correctly interpret. For this reason, the results of this function should not be displayed in a place where a novice user is likely to see it.

ResetVideoMediaStatistics

Use the ResetVideoMediaStatistics function to reset the video media handler's counters before using GetVideoMediaStatistics to determine the frame rate of a movie. This call can only be used on video or MPEG media handlers.

pascal HandlerError ResetVideoMediaStatistics (
                     MediaHandler mh);
mh
Contains a reference to a video media handler. You obtain this reference from the GetMediaHandler function.
function result
Returns a handle error.

Description

The ResetVideoMediaStatistics function resets the video media handler's frame rate counters.

RESULT CODES

badComponentInstance

0x80008001

Invalid component instance specified.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next